﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demos.DesignPatterns._10_装饰器模式
{
    /// <summary>
    /// 牛奶咖啡装饰器
    /// </summary>
    public class MilkDecorator: CoffeeDecorator
    {
        public MilkDecorator(ICoffee coffee) :base(coffee)
        {
        }

        public override string GetDescription()
        {
            return $"{base.GetDescription()}+牛奶";
        }

        /// <summary>
        /// 获取价格
        /// </summary>
        /// <returns></returns>
        public override decimal GetCost()
        {
            return base.GetCost()+2m;
        }

    }
}
